home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Documentation / Tech Notes & Articles / Recipes / Standards / Object Equality < prev    next >
Encoding:
Text File  |  1995-07-11  |  1.1 KB  |  24 lines  |  [TEXT/ttxt]

  1. OpenDocâ„¢ Recipes
  2.  
  3. Object Equality
  4. By The OpenDoc Design Team
  5. July 11,1995.
  6.  
  7.  
  8. © 1993-1995  Apple Computer, Inc. All Rights Reserved.
  9. Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
  10. Mac and OpenDoc are trademarks of Apple Computer, Inc.
  11.  
  12.  
  13. Overview
  14.  
  15. This document describes how object references should be compared in OpenDoc and the motivation behind it.
  16.  
  17. IsEqualTo
  18.  
  19. In many places in the part code, object equality is determined by comparing  pointers. This will fail when we move to a distributed environment. That's why ODObject has the method ODBoolean ODObject::IsEqualTo(in ODObject anotherObject). The purpose of this method is to determine whether two object refs refer to the same object. If so, kODTrue is returned. Otherwise, kODFalse is returned.
  20.  
  21. In addition, we have created a function in ODUtils called ODObjectsAreEqual. This function does a pointer comparison when it is legal to do so, thereby preventing the cost of calling ODObject::IsEqualTo.
  22.  
  23. In summary, it is required to use ODObjectsAreEqual or ODObject::IsEqualTo for all object pointer comparison. 
  24.